Add aspire dashboard CLI command and introduce unified IProcessExecutionFactory#15607
Add aspire dashboard CLI command and introduce unified IProcessExecutionFactory#15607
aspire dashboard CLI command and introduce unified IProcessExecutionFactory#15607Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15607Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15607" |
There was a problem hiding this comment.
Pull request overview
Adds a new aspire dashboard top-level CLI command to launch the standalone Aspire Dashboard via the bundled aspire-managed binary, integrating it into the root command set and localized resources.
Changes:
- Registers a new
DashboardCommandin the CLI host and root command, categorized under the Monitoring help group. - Implements foreground and
--detachexecution paths and introduces localized resource strings for the new command. - Adds initial unit tests covering
--helpand the “bundle not available” error case.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs | Registers DashboardCommand in the test DI container. |
| tests/Aspire.Cli.Tests/Commands/DashboardCommandTests.cs | Adds tests for help and missing-bundle error behavior. |
| src/Aspire.Cli/Program.cs | Registers DashboardCommand in the production DI container. |
| src/Aspire.Cli/Commands/RootCommand.cs | Adds dashboard as a root subcommand. |
| src/Aspire.Cli/Commands/DashboardCommand.cs | Implements the new aspire dashboard command (foreground/detach + arg pass-through). |
| src/Aspire.Cli/Resources/DashboardCommandStrings.resx | Adds new localized strings for the dashboard command. |
| src/Aspire.Cli/Resources/DashboardCommandStrings.Designer.cs | Strongly-typed accessor for the new dashboard strings. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.cs.xlf | Localization XLF for cs. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.de.xlf | Localization XLF for de. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.es.xlf | Localization XLF for es. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.fr.xlf | Localization XLF for fr. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.it.xlf | Localization XLF for it. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ja.xlf | Localization XLF for ja. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ko.xlf | Localization XLF for ko. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.pl.xlf | Localization XLF for pl. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.pt-BR.xlf | Localization XLF for pt-BR. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.ru.xlf | Localization XLF for ru. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.tr.xlf | Localization XLF for tr. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.zh-Hans.xlf | Localization XLF for zh-Hans. |
| src/Aspire.Cli/Resources/xlf/DashboardCommandStrings.zh-Hant.xlf | Localization XLF for zh-Hant. |
Files not reviewed (1)
- src/Aspire.Cli/Resources/DashboardCommandStrings.Designer.cs: Language not supported
|
Would it make sense to have an alias |
|
To me, |
56a4214 to
2514d2c
Compare
aspire dashboard CLI command and introduce unified IProcessExecutionFactory
- Dispose IProcessExecution in DotNetCliRunner.ExecuteAsync to prevent handle leaks - Check Start() return value in LayoutProcessRunner and throw on failure - Use OptionResult.Implicit to avoid emitting default bool option values - Recognize bare --KEY tokens (boolean flags) in ConfigSettingHasValue - Add tests for bare-key and implicit-default behaviors
- Add bounds check on Split result to prevent IndexOutOfRangeException when ASPNETCORE_URLS is empty or contains only semicolons - Add ResolveSettingValue method that checks args, unmatched tokens, and env vars so the summary URL reflects the actual dashboard binding - Add parameterized tests for frontend URL variants and env var/token resolution - Rename StartupTests validation failure test to match exit code naming
|
🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23749387829 |
There was a problem hiding this comment.
couple thoughts on the command shape:
aspire ps won't find a standalone dashboard — it discovers running AppHosts via backchannel sockets in ~/.aspire/cli/backchannels, and aspire dashboard doesn't register anything there. so once you start a dashboard you have no way to get the URL/token/status back from the CLI. do we need a different mechanism for dashboards?
feels like this should be aspire dashboard start rather than just aspire dashboard — leaves room for aspire dashboard stop/aspire dashboard status later, and matches the pattern we already have with config, secret, otel, certs, etc.
also, should this support --detach? aspire run already has it and a standalone dashboard seems like an even better candidate for running in the background. related — does the standalone dashboard need --isolated support to avoid port conflicts if someone's already running an AppHost with its own dashboard or if people want to start multiple?
|
Yes I had the same thoughts. Right now this is basically If we want
It becomes a lot more complicated. @davidfowl How far do you want to go with this? |
|
I think we do |
Description
Add a new
aspire dashboardCLI command that starts a standalone Aspire Dashboard instance using theaspire-managedbinary from the CLI bundle, and refactor the process execution infrastructure to support both dotnet CLI and non-dotnet processes through a single abstraction.aspire dashboardcommand--frontend-url,--otlp-grpc-url,--otlp-http-url,--allow-anonymous,--config-file-path--KEY=value/--KEY valuetokens, skipping defaults when already providedMonitoringhelp groupUnified process execution infrastructure
IDotNetCliExecutionFactory→IProcessExecutionFactoryandIDotNetCliExecution→IProcessExecutionto reflect that process execution is no longer dotnet-specificDotNetCliExecution→ProcessExecutionand deleted the oldDotNetCliExecutionFactoryMSBUILDTERMINALLOGGER,DOTNET_NOLOGO, private SDK resolution) fromDotNetCliExecutionFactoryintoDotNetCliRunner, keepingIProcessExecutionFactorygenericKill(bool entireProcessTree)andIDisposabletoIProcessExecutionso callers can manage process lifetimeDotNetCliRunnerInvocationOptions→ProcessInvocationOptionsLayoutProcessRunnerfrom a static helper using rawSystem.Diagnostics.Processto an instance class that delegates toIProcessExecutionFactory, making it testable via DIProcessExecutionFactorynow accepts afileNameparameter so it can launch any executable, not justdotnetDashboard exit code tests
StartupTests.Run_AddressAlreadyInUse_ReturnsExitCodeAddressInUseandRun_ValidationFailure_ReturnsNegativeOneto verify dashboard exit code behaviorValidation
DashboardCommandTestspass, covering default args, individual options (Theory), combined options, unmatched token forwarding, browser token generation, and process error handlingChecklist
aspire.devissue: